import csv
import json

# a = {'a':1,'b':2}
# print(a.keys())
# print(type(a.keys()))
# c = list(a.keys())
# print(c)
# print(type(c))
# a.values()

class Tool(object):
    def __init__(self):
        super(Tool, self).__init__()

    def convertJson(self,data):
        data_json = json.dumps(data)
        return data_json

    def convertCsv(self, path, data):
        """

        :param path:
        :param data: dict_data = {'RotX':[30,0,0,1,10] ,'RotY':[0,30,0,1,10],
        'RotZ':[0,0,30,1,10]}
a = []
for i in range(len(vuale_test)):
    for y in vuale_test:
        a.append(y[i])



        dict_data = {'RotX': ,'RotY': ,'RotZ':}
        :return:
        """
        headers = list(data.keys())
        date_csv = list(data.values())
        with open(path, 'w', newline='') as w:
            w_csv = csv.writer(w)
            w_csv.writerow(headers)
            w_csv.writerows(date_csv)



tool = Tool()
list_value = [[30,0,0,1,10],[0,30,0,1,10],[0,0,30,1,10]]

for i in range(len(list_value[0])):
    dict_value = []
    for y in list_value:
        dict_value.append(y[i])

for ii in dict_value:
    for yy in range(len(ii))

dict_data = {'RotX': ,'RotY':[0,30,0,1,10],
        'RotZ':[0,0,30,1,10]}


t = tool.convertJson(dict_data)
print(t)


tool.convertCsv(r'E:\pycharm_out\yufa\git_test\aaa.csv', dict_data)
